<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <meta property="og:title" content="<%= webpackConfig.name %>">
  <link rel="icon" href="<%= BASE_URL %>favicon.ico">
  <title>
    <%= webpackConfig.name %>
  </title>
  <!-- 使用纯Cesium进行开发 -->
  <!-- <script src="./js/Cesium/Cesium.js"></script>
  <script src="./krpano/tour.js"></script> -->
  <!-- <script src="./NodePlayer.js"></script> -->

  <!-- <link href="https://web.sdk.qcloud.com/player/tcplayer/release/v4.6.0/tcplayer.min.css" rel="stylesheet"/> -->
  <!--如果需要在 Chrome 和 Firefox 等现代浏览器中通过 H5 播放 Webrtc 视频，需要在 tcplayer.vx.x.x.min.js 之前引入 TXLivePlayer-x.x.x.min.js。-->
  <!--有些浏览器环境不支持 Webrtc，播放器会将 Webrtc 流地址自动转换为 HLS 格式地址，因此快直播场景同样需要引入hls.min.x.xx.xm.js。-->
  <!-- <script src="https://web.sdk.qcloud.com/player/tcplayer/release/v4.6.0/libs/TXLivePlayer-1.2.3.min.js"></script> -->

  <!--如果需要在 Chrome 和 Firefox 等现代浏览器中通过 H5 播放 FLV 格式的视频，需要在 tcplayer.vx.x.x.min.js 之前引入 flv.min.x.x.x.js。-->
  <!-- <script src="https://web.sdk.qcloud.com/player/tcplayer/release/v4.6.0/libs/flv.min.1.6.3.js"></script> -->
  <!--播放器脚本文件-->
  <!-- <script src="https://web.sdk.qcloud.com/player/tcplayer/release/v4.6.0/tcplayer.v4.6.0.min.js"></script> -->

  <!--阿里播放器-->
  <link rel="stylesheet" href="https://g.alicdn.com/de/prismplayer/2.13.2/skins/default/aliplayer-min.css" />
  <script charset="utf-8" type="text/javascript"
    src="https://g.alicdn.com/de/prismplayer/2.13.2/aliplayer-h5-min.js"></script>

  <script src="./aliyun-rts-sdk.js"></script>
  <link rel="stylesheet" href="./js/Cesium/Widgets/widgets.css">
  <script src="./js/jessibuca/jessibuca-pro.js"></script>

</head>

<body>
  <noscript>
    <strong>We're sorry but <%= webpackConfig.name %> doesn't work properly without JavaScript enabled. Please enable it
        to continue.</strong>
  </noscript>
  <div id="app"></div>
  <!-- built files will be auto injected -->
</body>

</html>
<script>
  let url = window.location.href

  // 路径包含sharedVideo的为分享直播页，不添加Cesium和krpano
  if (url.indexOf('sharedVideo') !== -1) {
    //  const cesiumScript = document.getElementById('cesiumScript');
    //  const krpanoScript = document.getElementById('krpanoScript');

    //  if(cesiumScript){
    //    document.head.removeChild(cesiumScript)
    //  }
    //  if (krpanoScript){
    //    document.head.removeChild(krpanoScript);
    //  }
    //  console.log(cesiumScript,krpanoScript);
  } else {
    if (!document.getElementById('cesiumScript')) {
      const cesiumScript = document.createElement('script')
      cesiumScript.type = 'text/javascript';
      cesiumScript.src = './js/Cesium/Cesium.js';
      cesiumScript.id = 'cesiumScript';
      document.head.appendChild(cesiumScript);
    }

    if (!document.getElementById('krpanoScript')) {
      const krpanoScript = document.createElement('script');
      krpanoScript.type = 'text/javascript';
      krpanoScript.src = './krpano/tour.js';
      krpanoScript.id = 'krpanoScript';
      document.head.appendChild(krpanoScript);
    }
  }
</script>